package org.hot100_6.leetcode206;

import org.algorithm.List.ListNode;

public class Solution3 {
    public ListNode reverseList(ListNode head) {
        ListNode pre = null;
        ListNode next = null;

        while (head!=null){
            next = head.next;
            head.next = pre;
            pre = head;
            head = next;
        }

        return pre;
    }
}
